﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SNAIL.Interfaces
{
    public partial class Settings : Form
    {
        public Settings(OutlookPanel.SortingSetting activesetting, int activeduration)
        {
            InitializeComponent();
            SetSetting = activesetting;
            numericUpDown1.Value = activeduration;
        }

        public OutlookPanel.SortingSetting SetSetting;

        private void Settings_Load(object sender, EventArgs e)
        {
            foreach (var item in Enum.GetNames(typeof(OutlookPanel.SortingSetting)))
            {
                comboBox1.Items.Add(item);
            }

            comboBox1.SelectedItem = SetSetting.ToString();            
        }

        public int DaysForCorrelation;

        private void cmdOK_Click(object sender, EventArgs e)
        {
            DaysForCorrelation = Convert.ToInt32(numericUpDown1.Value);
            SetSetting = (OutlookPanel.SortingSetting)Enum.Parse(typeof(OutlookPanel.SortingSetting), comboBox1.SelectedItem.ToString());
            this.Close();
        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
